import {showToast} from '../../utils/util';

Page({
  data: {
    userInfo: {},
    collect: []
  },
  onShow() {
    this.pageInit();
  },
  pageInit() {
    let userInfo = wx.getStorageSync('user');
    let collect = wx.getStorageSync('collect') || [];
    this.setData({userInfo, collect});
  },
  handleUerLogin(e) {
    let {userInfo} = e.detail;
    this.setData({userInfo});
    wx.setStorageSync('user', userInfo);
  },
  handleUnfinished: async function() {
    await showToast('抱歉，该功能尚未完善')
  }
})